<template>
	<view class="container">
		
		<view class="reportView">
			<uni-row class="uni-row">
				<uni-col>
					<text class="title">用户名称：</text>
					<view class="input-item flex align-center">
					  <input  placeholder="请输入用户名称" placeholder-class="place" v-model="FormData.nickname" class="input" type="text"  maxlength="30" />
					</view>
				</uni-col>
			</uni-row>
			<uni-row class="uni-row">
				<uni-col>
					<text class="title">登陆账号：</text>
					<view class="input-item flex align-center">
					  <input  placeholder="请输入登陆账号" placeholder-class="place"  v-model="FormData.username" class="input" type="text"  maxlength="30" />
					</view>
				</uni-col>
			</uni-row>
			<uni-row class="uni-row">
				<uni-col>
					<text class="title">登陆密码：</text>
					<view class="input-item flex align-center">
					  <input  placeholder="请输入登陆密码" placeholder-class="place"  v-model="FormData.mobile" class="input" type="password"  maxlength="30" />
					</view>
				</uni-col>
			</uni-row>
			<uni-row class="uni-row">
				<uni-col>
					<text class="title">手机号码：</text>
					<view class="input-item flex align-center">
					  <input  placeholder="请输入手机号码" placeholder-class="place"  v-model="FormData.majorNum" class="input" type="text"  maxlength="30" />
					</view>
				</uni-col>
			</uni-row>
		</view>
		
		<view class="submit-view">
			<button class='submit'  @tap="clickBtn">完成</button>
		</view>
	</view>
</template>
<script>
	import { getTeacherById } from '@/api/school/school.js'
	export default{
		data(){
			return{
				id:null,
				range:[{
					text:'开启',
					value:0
				},{
					text:'关闭',
					value:1
				}],
				FormData:{
					parentId:1,
					categoryName:null,
					categoryDesc:null,
					sort:1,
					status:null,
					type:null,
					photoUrl:null
				}
				
			}
		},
		onLoad(e) {
			if(e.id != null && e.id != ''){
				this.id = e.id
				this.getData();
			}
		},
		created() {
			
		},
		methods:{
			clickToBank(){
				this.$tab.navigateTo(`/pages/work/exam/questionBank`)
			},
			getData(){
				let data={
					id:this.id
				}
				getTeacherById(data).then(res=>{
					this.FormData = res.data
				})
			},
			clickBtn(){
				updateCate(this.FormData).then(res=>{
					if(res.data === true){
						uni.navigateBack({
							delta:1
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.container{
		background-color: #fff;
		height: 100vh;
		.reportView{
			width: calc(100% - 80rpx);
			margin: 0 auto;
			.title{
				font-size: 14px;
				font-family: Inter-Bold, Inter;
				font-weight: bold;
				color: #000000;
				line-height: 40px;
				padding-left: 10px;
			}
			.textarea{
				
			}
			
			.input-item{
				background-color: #ffffff;
				height: 47px;
				border-radius: 10px;
				opacity: 1;
				border: 1px solid #508CFF;
				padding: 20px;
				.place{
					font-size: 12px;
				}
				/deep/ .uni-select{
					border: none;
					border-bottom: none;
					padding-left: 0;
				}
			}
			.uni-row{
				margin-bottom: 10px;
			}
			
		}
		.submit{
			color: #fff;
			width: 100px;
			height: 40px;
			font-size: 14px;
			line-height: 40px;
			background: #508CFF;
			border-radius: 5px 5px 5px 5px;
			position: absolute;
			bottom: 50px;
			left: 36%;
		}
	}
</style>